package com.feishi.project.javafx.demo;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.stage.FileChooser;
import javafx.stage.Stage;

import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: caixq
 * Date: 2020-10-30
 * Time: 下午5:21
 */
public class SampleController {
    @FXML
    private TextField start;
    @FXML
    private TextField end;
    @FXML
    private Button selectFile;

    public void selectFile(MouseEvent mouseEvent) {
        Stage stage = (Stage) selectFile.getScene().getWindow();
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle("Open Resource File");
        File file = fileChooser.showOpenDialog(stage);
        System.out.println(file.getPath());
    }
}
